# $Id$
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=archlinux-appstream-data
pkgver=20170929
pkgrel=1
pkgdesc="Arch Linux application database for AppStream-based software centers"
arch=(any)
url="http://www.archlinux.org"
license=(GPL)
depends=()
makedepends=()
source=()
noextract=()
for _repo in core extra community; do
 source+=($_repo.xml.gz::https://sources.archlinux.org/other/packages/$pkgname/$pkgver/$_repo/Components-x86_64.xml.gz
          $_repo-icons-64x64.tar.gz::https://sources.archlinux.org/other/packages/$pkgname/$pkgver/$_repo/icons-64x64.tar.gz
          $_repo-icons-128x128.tar.gz::https://sources.archlinux.org/other/packages/$pkgname/$pkgver/$_repo/icons-128x128.tar.gz)
 noextract+=($_repo.xml.gz $_repo-icons-{64x64,128x128}.tar.gz)
done
sha256sums=('2bc6b345279172d67dce612ef9069354b3ed93c040ea799cc9339bfbbada1ca8'
            '7989bb311baa38ef545250282aa065d23281c46dfb8faabe4c653487bdbded5c'
            '7989bb311baa38ef545250282aa065d23281c46dfb8faabe4c653487bdbded5c'
            '2bc5da3da45433bb030861fed593a938c1dea4937c3a4ed263a42e194c33a090'
            '37c8bf3eecaa57f50a09db3fb97cd3e7911d91724055b683b85b63babb1d8163'
            '9b476f797ebdaef519c46e1cfe0c205f8bcf0bf9c81869a8296bdf4ab220070e'
            '0d0e1f4591b29cb149a00038930978fce6ec5d153bd7f15712234e6e1b6f4e86'
            'daebb861528f243c44f6507c7598e280e284961997d5c5e751ec3ffa45908e51'
            'f373d5b0eedce61114521bff2d58de4d436e5fe375c15522bceaf3b6356c6cea')

package() {
  mkdir -p "$pkgdir"/usr/share/app-info/{icons/archlinux-arch-{core,extra,community}/{64x64,128x128},xmls}
  for _repo in core extra community; do
   tar -xzf $_repo-icons-64x64.tar.gz -C "$pkgdir"/usr/share/app-info/icons/archlinux-arch-$_repo/64x64
   tar -xzf $_repo-icons-128x128.tar.gz -C "$pkgdir"/usr/share/app-info/icons/archlinux-arch-$_repo/128x128
  done
  cp *.xml.gz "$pkgdir"/usr/share/app-info/xmls/
}
